home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 46 / Amiga Format CD46 (1999-10-20)(Future Publishing)(GB)[!][issue 1999-12].iso / -serious- / programming / other / tandem / teaching / 23.asm < prev    next >
Assembly Source File  |  1999-09-06  |  2KB  |  35 lines

  1. * 23.asm      Introduce Tandem's standard frontend    version 0.00   1.9.97
  2.  
  3.  
  4. * This program simply puts a message on Tandem's CLI window. When you
  5. * run this program, you will see the message appear (after running, press
  6. * Left Amiga/M to switch screens so you can see Tandem's CLI window)
  7.  
  8.  
  9. * If you step this program through, you will see it first sets up a 1024
  10. * byte block in the stack, with A4 pointing to it. It then opens libraries,
  11. * and a few other bits & pieces, and finally calls 'Program'; in order for
  12. * the front end to work, you need to make the entry point of your program
  13. * a subroutine called 'Program', and also a list of 0 or more null delimited
  14. * strings labelled 'strings' (as below). The frontend opens the commonest
  15. * libraries, and tandem.library, and then closes them after calling Program,
  16. * so you can thus forget the nuisance of opening & closing the commonest
  17. * libraries. tandem.library calls do all sorts of other things, and there
  18. * are MACROs in incall.i for easy calling of tandem.library routines.
  19.  
  20.  
  21.  include 'Front.i'         ;opens libraries etc and BSR's Program
  22.  
  23. * text strings
  24. strings: dc.b 0            ;Front.i requires this line
  25.  dc.b 'Hello, world',0     ;string 1
  26.  ds.w 0                    ;re-align mc
  27.  
  28. * print a hello message
  29. Program:                   ;Entry point is Program, A4 points to xxp_tndm
  30.  move.l xxp_tanb(a4),a6    ;get tanbase
  31.  moveq #1,d0
  32.  jsr _LVOTLStrbuf(a6)      ;tfr string 1 to xxp_buff
  33.  jsr _LVOTLOutput(a6)      ;ouput xxp_buff to output window
  34.  rts                       ;quit
  35.